package com.ykz2015.chapter3;

import com.sun.org.apache.bcel.internal.util.ClassPath;
import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
import com.ykz2015.chapter3.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.PropertySource;

import javax.sound.midi.Soundbank;
import java.sql.SQLOutput;

@SpringBootApplication
//value是个数组，可以存多个
@PropertySource(value="database.properties",ignoreResourceNotFound=true)
public class Chapter3Application {

    @Autowired
    public static void main(String[] args) throws IllegalAccessException, InstantiationException {
        System.out.println("hello");

        //这里无论是//@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) //u1==u2返回false
        //@Scope(value = ConfigurableBeanFactory.SCOPE_SINGLETON) //u1==u2返回fasle。返回的都是false

        User u1=User.class.newInstance();
        User u2=User.class.newInstance();
        System.out.println(u1==u2);
        SpringApplication.run(Chapter3Application.class, args);
    }

}
